#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int V = 305;
const int N = 2005;
const double INF = 1e9;

int n, m, v, e;
int c[N], d[N];
double p[N];
int g[V][V];
void floyd() {
  rep(k, 1, v) rep(i, 1, v) rep(j, 1, v) {
    g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
  }
}
double dp[N][N][2];
double dis(int i, int u, int v) {
  int d00 = g[c[i]][c[i + 1]];
  int d01 = g[c[i]][d[i + 1]];
  int d10 = g[d[i]][c[i + 1]];
  int d11 = g[d[i]][d[i + 1]];

  if (!u) {
    if (!v)
      return d00;
    else
      return (1 - p[i + 1]) * d00 + p[i + 1] * d01;
  } else {
    if (!v)
      return (1 - p[i]) * d00 + p[i] * d10;
    else
      return (1 - p[i]) * ((1 - p[i + 1]) * d00 + p[i + 1] * d01) +
             p[i] * ((1 - p[i + 1]) * d10 + p[i + 1] * d11);
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m >> v >> e;
  rep(i, 1, n) cin >> c[i];
  rep(i, 1, n) cin >> d[i];
  rep(i, 1, n) cin >> p[i];
  memset(g, 0x3f, sizeof(g));
  rep(i, 1, e) {
    int u, v, w;
    cin >> u >> v >> w;
    g[u][v] = g[v][u] = min(g[u][v], w);
  }
  rep(i, 1, v) g[i][i] = 0;
  floyd();
  rep(i, 0, n) rep(j, 0, n) dp[i][j][0] = dp[i][j][1] = INF;
  dp[1][0][0] = dp[1][1][1] = 0;
  rep(i, 1, n - 1) {
    rep(j, 0, n - 1) {
      rep(u, 0, 1) {
        rep(v, 0, 1) {
          double x = dis(i, u, v);
          dp[i + 1][j + v][v] = min(dp[i + 1][j + v][v], dp[i][j][u] + x);
        }
      }
    }
  }
  double ans = INF;
  rep(j, 0, m) rep(u, 0, 1) ans = min(ans, dp[n][j][u]);
  cout << fixed << setprecision(2) << ans;
  return 0;
}